<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class RBS::Annotate::RDocAnnotator - rbs: Ruby Standard Library Documentation</title>


<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<script src="../../js/jquery-3.2.0.min.js"></script>

<script src="../../js/vue.min.js"></script>
<script src="../../js/js.cookie.min.js"></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../css/rdoc.css" rel="stylesheet">
<link href="../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
  var darkModeCsseHref = "../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-annotate_alias">#annotate_alias</a>
    <li ><a href="#method-i-annotate_attribute">#annotate_attribute</a>
    <li ><a href="#method-i-annotate_class">#annotate_class</a>
    <li ><a href="#method-i-annotate_constant">#annotate_constant</a>
    <li ><a href="#method-i-annotate_decls">#annotate_decls</a>
    <li ><a href="#method-i-annotate_file">#annotate_file</a>
    <li ><a href="#method-i-annotate_method">#annotate_method</a>
    <li ><a href="#method-i-annotations">#annotations</a>
    <li ><a href="#method-i-doc_for_alias">#doc_for_alias</a>
    <li ><a href="#method-i-doc_for_attribute">#doc_for_attribute</a>
    <li ><a href="#method-i-doc_for_class">#doc_for_class</a>
    <li ><a href="#method-i-doc_for_constant">#doc_for_constant</a>
    <li ><a href="#method-i-doc_for_method">#doc_for_method</a>
    <li ><a href="#method-i-doc_for_method0">#doc_for_method0</a>
    <li ><a href="#method-i-each_part">#each_part</a>
    <li ><a href="#method-i-join_docs">#join_docs</a>
    <li ><a href="#method-i-replace_comment">#replace_comment</a>
    <li ><a href="#method-i-resolve_doc_source">#resolve_doc_source</a>
    <li ><a href="#method-i-resolve_name">#resolve_name</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-RBS::Annotate::RDocAnnotator">
    <h1 id="class-RBS::Annotate::RDocAnnotator" class="class">
      class RBS::Annotate::RDocAnnotator
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-include_arg_lists" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">include_arg_lists</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-include_filename" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">include_filename</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-source" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">source</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(source:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 9</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-value">source:</span>)
  <span class="ruby-ivar">@source</span> = <span class="ruby-identifier">source</span>

  <span class="ruby-ivar">@include_arg_lists</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@include_filename</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-annotate_alias" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">annotate_alias</span><span
                                class="method-args">(typename, als)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="annotate_alias-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 282</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">annotate_alias</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-identifier">als</span>)
  <span class="ruby-identifier">annots</span> = <span class="ruby-identifier">annotations</span>(<span class="ruby-identifier">als</span>)

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">annots</span>.<span class="ruby-identifier">skip?</span>
    <span class="ruby-identifier">text</span> = <span class="ruby-identifier">resolve_doc_source</span>(<span class="ruby-identifier">annots</span>.<span class="ruby-identifier">copy_annotation</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>) <span class="ruby-keyword">do</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">als</span>.<span class="ruby-identifier">kind</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:instance</span>
        <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-identifier">als</span>.<span class="ruby-identifier">new_name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-value">:singleton</span>
        <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-identifier">als</span>.<span class="ruby-identifier">new_name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">replace_comment</span>(<span class="ruby-identifier">als</span>, <span class="ruby-identifier">text</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-annotate_attribute" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">annotate_attribute</span><span
                                class="method-args">(typename, attr)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="annotate_attribute-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 341</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">annotate_attribute</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-identifier">attr</span>)
  <span class="ruby-identifier">annots</span> = <span class="ruby-identifier">annotations</span>(<span class="ruby-identifier">attr</span>)

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">annots</span>.<span class="ruby-identifier">skip?</span>
    <span class="ruby-identifier">text</span> = <span class="ruby-identifier">resolve_doc_source</span>(<span class="ruby-identifier">annots</span>.<span class="ruby-identifier">copy_annotation</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>) <span class="ruby-keyword">do</span>
      <span class="ruby-comment"># @type var docs: Array[String?]</span>
      <span class="ruby-identifier">docs</span> = []

      <span class="ruby-keyword">case</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">kind</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:instance</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrReader</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrAccessor</span>)
          <span class="ruby-identifier">docs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
        <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrWriter</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrAccessor</span>)
          <span class="ruby-identifier">docs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-value">:&quot;#{attr.name}=&quot;</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:singleton</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrReader</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrAccessor</span>)
          <span class="ruby-identifier">docs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
        <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrWriter</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrAccessor</span>)
          <span class="ruby-identifier">docs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-value">:&quot;#{attr.name}=&quot;</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">join_docs</span>(<span class="ruby-identifier">docs</span>.<span class="ruby-identifier">uniq</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">replace_comment</span>(<span class="ruby-identifier">attr</span>, <span class="ruby-identifier">text</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-annotate_class" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">annotate_class</span><span
                                class="method-args">(decl, outer:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="annotate_class-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 245</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">annotate_class</span>(<span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span>)
  <span class="ruby-identifier">annots</span> = <span class="ruby-identifier">annotations</span>(<span class="ruby-identifier">decl</span>)

  <span class="ruby-identifier">full_name</span> = <span class="ruby-identifier">resolve_name</span>(<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">annots</span>.<span class="ruby-identifier">skip?</span>
    <span class="ruby-identifier">text</span> = <span class="ruby-identifier">resolve_doc_source</span>(<span class="ruby-identifier">annots</span>.<span class="ruby-identifier">copy_annotation</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>) { <span class="ruby-identifier">doc_for_class</span>(<span class="ruby-identifier">full_name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>) }
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">replace_comment</span>(<span class="ruby-identifier">decl</span>, <span class="ruby-identifier">text</span>)

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">annots</span>.<span class="ruby-identifier">skip_all?</span>
    <span class="ruby-identifier">outer_</span> = <span class="ruby-identifier">outer</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_namespace</span>]

    <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">each_member</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">member</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">member</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">MethodDefinition</span>
        <span class="ruby-identifier">annotate_method</span>(<span class="ruby-identifier">full_name</span>, <span class="ruby-identifier">member</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Alias</span>
        <span class="ruby-identifier">annotate_alias</span>(<span class="ruby-identifier">full_name</span>, <span class="ruby-identifier">member</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrReader</span>, <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrAccessor</span>, <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrWriter</span>
        <span class="ruby-identifier">annotate_attribute</span>(<span class="ruby-identifier">full_name</span>, <span class="ruby-identifier">member</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">annotate_decls</span>(<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">each_decl</span>.<span class="ruby-identifier">to_a</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer_</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-annotate_constant" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">annotate_constant</span><span
                                class="method-args">(const, outer:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="annotate_constant-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 273</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">annotate_constant</span>(<span class="ruby-identifier">const</span>, <span class="ruby-value">outer:</span>)
  <span class="ruby-identifier">annots</span> = <span class="ruby-constant">Annotations</span>.<span class="ruby-identifier">new</span>([])

  <span class="ruby-identifier">full_name</span> = <span class="ruby-identifier">resolve_name</span>(<span class="ruby-identifier">const</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)
  <span class="ruby-identifier">text</span> = <span class="ruby-identifier">doc_for_constant</span>(<span class="ruby-identifier">full_name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)

  <span class="ruby-identifier">replace_comment</span>(<span class="ruby-identifier">const</span>, <span class="ruby-identifier">text</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-annotate_decls" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">annotate_decls</span><span
                                class="method-args">(decls, outer: [])</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="annotate_decls-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 28</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">annotate_decls</span>(<span class="ruby-identifier">decls</span>, <span class="ruby-value">outer:</span> [])
  <span class="ruby-identifier">decls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">decl</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>, <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span>
      <span class="ruby-identifier">annotate_class</span>(<span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Constant</span>
      <span class="ruby-identifier">annotate_constant</span>(<span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-annotate_file" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">annotate_file</span><span
                                class="method-args">(path, preserve:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="annotate_file-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 16</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">annotate_file</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value">preserve:</span>)
  <span class="ruby-identifier">content</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">read</span>()

  <span class="ruby-identifier">_</span>, <span class="ruby-identifier">_</span>, <span class="ruby-identifier">decls</span> = <span class="ruby-constant">Parser</span>.<span class="ruby-identifier">parse_signature</span>(<span class="ruby-identifier">content</span>)

  <span class="ruby-identifier">annotate_decls</span>(<span class="ruby-identifier">decls</span>)

  <span class="ruby-identifier">path</span>.<span class="ruby-identifier">open</span>(<span class="ruby-string">&quot;w&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">Writer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">out:</span> <span class="ruby-identifier">io</span>).<span class="ruby-identifier">preserve!</span>(<span class="ruby-value">preserve:</span> <span class="ruby-identifier">preserve</span>).<span class="ruby-identifier">write</span>(<span class="ruby-identifier">decls</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-annotate_method" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">annotate_method</span><span
                                class="method-args">(typename, method)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="annotate_method-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 312</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">annotate_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-identifier">method</span>)
  <span class="ruby-identifier">annots</span> = <span class="ruby-identifier">annotations</span>(<span class="ruby-identifier">method</span>)

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">annots</span>.<span class="ruby-identifier">skip?</span>
    <span class="ruby-identifier">text</span> = <span class="ruby-identifier">resolve_doc_source</span>(<span class="ruby-identifier">annots</span>.<span class="ruby-identifier">copy_annotation</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>) {
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">kind</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:singleton</span>
        <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-value">:instance</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-value">:initialize</span>
          <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-value">:initialize</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>) <span class="ruby-operator">||</span>
            <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-value">:new</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:singleton_instance</span>
        <span class="ruby-identifier">join_docs</span>(
          [
            <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>),
            <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">annots</span>)
          ].<span class="ruby-identifier">uniq</span>
        )
      <span class="ruby-keyword">end</span>
    }
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">replace_comment</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">text</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-annotations" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">annotations</span><span
                                class="method-args">(annots)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="annotations-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 393</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">annotations</span>(<span class="ruby-identifier">annots</span>)
  <span class="ruby-comment"># @type var as: Array[Annotations::t]</span>
  <span class="ruby-identifier">as</span> = <span class="ruby-identifier">_</span> = <span class="ruby-identifier">annots</span>.<span class="ruby-identifier">annotations</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">annot</span><span class="ruby-operator">|</span> <span class="ruby-constant">Annotations</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">annot</span>) }.<span class="ruby-identifier">compact</span>
  <span class="ruby-constant">Annotations</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">as</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-doc_for_alias" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">doc_for_alias</span><span
                                class="method-args">(typename, name:, singleton:, tester:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="doc_for_alias-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 187</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">doc_for_alias</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">name:</span>, <span class="ruby-value">singleton:</span>, <span class="ruby-value">tester:</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">as</span> =
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton</span>
      <span class="ruby-identifier">source</span>.<span class="ruby-identifier">find_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">source</span>.<span class="ruby-identifier">find_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>

    <span class="ruby-identifier">each_part</span>(<span class="ruby-identifier">as</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">doc</span>, <span class="ruby-identifier">obj</span><span class="ruby-operator">|</span>
      <span class="ruby-comment"># @type var method: RDoc::AnyMethod</span>
      <span class="ruby-identifier">method</span> = <span class="ruby-identifier">_</span> = <span class="ruby-identifier">obj</span>

      <span class="ruby-keyword">if</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">is_alias_for</span>
        <span class="ruby-identifier">text</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-identifier">doc</span>) <span class="ruby-keyword">or</span> <span class="ruby-keyword">next</span>

        <span class="ruby-keyword">unless</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
          <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;!-- rdoc-file=#{doc.file} --&gt;&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">include_filename</span>
          <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-value">newline_at_end:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-doc_for_attribute" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">doc_for_attribute</span><span
                                class="method-args">(typename, attr_name, require: nil, singleton:, tester:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="doc_for_attribute-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 215</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">doc_for_attribute</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-identifier">attr_name</span>, <span class="ruby-value">require:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">singleton:</span>, <span class="ruby-value">tester:</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">as</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">find_attribute</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-identifier">attr_name</span>, <span class="ruby-value">singleton:</span> <span class="ruby-identifier">singleton</span>)
    <span class="ruby-identifier">as</span> = <span class="ruby-identifier">as</span>.<span class="ruby-identifier">select</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">require</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;R&quot;</span>
        <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">rw</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;R&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">rw</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;RW&quot;</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;W&quot;</span>
        <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">rw</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;W&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">attr</span>.<span class="ruby-identifier">rw</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;RW&quot;</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-keyword">true</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">as</span>.<span class="ruby-identifier">empty?</span>

    <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>()

    <span class="ruby-identifier">each_part</span>(<span class="ruby-identifier">as</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">doc</span>, <span class="ruby-identifier">obj</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">text</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-identifier">doc</span>)
        <span class="ruby-keyword">unless</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
          <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;!-- rdoc-file=#{doc.file} --&gt;&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">include_filename</span>
          <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-value">newline_at_end:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-doc_for_class" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">doc_for_class</span><span
                                class="method-args">(name, tester:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="doc_for_class-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 66</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">doc_for_class</span>(<span class="ruby-identifier">name</span>, <span class="ruby-value">tester:</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">clss</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">find_class</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>()

    <span class="ruby-identifier">each_part</span>(<span class="ruby-identifier">clss</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">doc</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">text</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-identifier">doc</span>) <span class="ruby-keyword">or</span> <span class="ruby-keyword">next</span>

      <span class="ruby-keyword">unless</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">include_filename</span>
          <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;!-- rdoc-file=#{doc.file} --&gt;&quot;</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>

        <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">margin</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-value">newline_at_end:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-doc_for_constant" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">doc_for_constant</span><span
                                class="method-args">(name, tester:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="doc_for_constant-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 87</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">doc_for_constant</span>(<span class="ruby-identifier">name</span>, <span class="ruby-value">tester:</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">constants</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">find_const</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>

    <span class="ruby-identifier">each_part</span>(<span class="ruby-identifier">constants</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">doc</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">text</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-identifier">doc</span>) <span class="ruby-keyword">or</span> <span class="ruby-keyword">next</span>

      <span class="ruby-keyword">unless</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">include_filename</span>
          <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;!-- rdoc-file=#{doc.file} --&gt;&quot;</span>
        <span class="ruby-keyword">end</span>

        <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>

        <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">margin</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-value">newline_at_end:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-doc_for_method" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">doc_for_method</span><span
                                class="method-args">(typename, instance_method: nil, singleton_method: nil, tester:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="doc_for_method-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 145</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">doc_for_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">tester:</span>)
  <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>()

  <span class="ruby-keyword">case</span>
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">method</span> = <span class="ruby-identifier">instance_method</span>
    <span class="ruby-identifier">doc</span> = <span class="ruby-identifier">doc_for_alias</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">name:</span> <span class="ruby-identifier">method</span>, <span class="ruby-value">singleton:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>)
    <span class="ruby-identifier">doc</span> = <span class="ruby-identifier">doc_for_method0</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-identifier">method</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">doc</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">doc</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-keyword">if</span> (<span class="ruby-identifier">s</span> = <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\A[a-zA-Z_]/</span>
        <span class="ruby-comment"># may be attribute</span>
        <span class="ruby-identifier">doc</span> =
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-string">&quot;=&quot;</span>)
            <span class="ruby-identifier">doc_for_attribute</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-identifier">s</span>.<span class="ruby-identifier">delete_suffix</span>(<span class="ruby-string">&quot;=&quot;</span>).<span class="ruby-identifier">to_sym</span>, <span class="ruby-value">require:</span> <span class="ruby-string">&quot;W&quot;</span>, <span class="ruby-value">singleton:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>)
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">doc_for_attribute</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_sym</span>, <span class="ruby-value">require:</span> <span class="ruby-string">&quot;R&quot;</span>, <span class="ruby-value">singleton:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>)
          <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">method</span> = <span class="ruby-identifier">singleton_method</span>
    <span class="ruby-identifier">doc</span> = <span class="ruby-identifier">doc_for_alias</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">name:</span> <span class="ruby-identifier">method</span>, <span class="ruby-value">singleton:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>)
    <span class="ruby-identifier">doc</span> = <span class="ruby-identifier">doc_for_method0</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-identifier">method</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">doc</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">doc</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-keyword">if</span> (<span class="ruby-identifier">s</span> = <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\A[a-zA-Z_]/</span>
        <span class="ruby-comment"># may be attribute</span>
        <span class="ruby-identifier">doc</span> =
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-string">&quot;=&quot;</span>)
            <span class="ruby-identifier">doc_for_attribute</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-identifier">s</span>.<span class="ruby-identifier">delete_suffix</span>(<span class="ruby-string">&quot;=&quot;</span>).<span class="ruby-identifier">to_sym</span>, <span class="ruby-value">require:</span> <span class="ruby-string">&quot;W&quot;</span>, <span class="ruby-value">singleton:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>)
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">doc_for_attribute</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_sym</span>, <span class="ruby-value">require:</span> <span class="ruby-string">&quot;R&quot;</span>, <span class="ruby-value">singleton:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>)
          <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">doc</span>
    <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">doc</span>
    <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-value">newline_at_end:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-doc_for_method0" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">doc_for_method0</span><span
                                class="method-args">(typename, instance_method: nil, singleton_method: nil, tester:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="doc_for_method0-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 109</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">doc_for_method0</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">tester:</span>)
  <span class="ruby-identifier">ms</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">find_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-identifier">instance_method</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">instance_method</span>
  <span class="ruby-identifier">ms</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">find_method</span>(<span class="ruby-identifier">typename</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-identifier">singleton_method</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">singleton_method</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">ms</span>
    <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>

    <span class="ruby-identifier">each_part</span>(<span class="ruby-identifier">ms</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">doc</span>, <span class="ruby-identifier">method</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">text</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-identifier">doc</span>) <span class="ruby-keyword">or</span> <span class="ruby-keyword">next</span>
      <span class="ruby-comment"># @type var as: String?</span>
      <span class="ruby-identifier">as</span> = (<span class="ruby-identifier">_</span> = <span class="ruby-identifier">method</span>).<span class="ruby-identifier">arglists</span>

      <span class="ruby-keyword">if</span> <span class="ruby-identifier">include_arg_lists</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">as</span>
        <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;!--&quot;</span>
        <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;  rdoc-file=#{doc.file}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">include_filename</span>
        <span class="ruby-identifier">as</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;  - #{line.strip}&quot;</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;--&gt;&quot;</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">include_filename</span>
          <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;!-- rdoc-file=#{doc.file} --&gt;&quot;</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-keyword">unless</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">margin</span>(<span class="ruby-value">separator:</span> <span class="ruby-string">&quot;----&quot;</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-value">newline_at_end:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-each_part" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">each_part</span><span
                                class="method-args">(subjects, tester:) { |doc, subject| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="each_part-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 39</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">each_part</span>(<span class="ruby-identifier">subjects</span>, <span class="ruby-value">tester:</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
    <span class="ruby-identifier">subjects</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">subject</span>, <span class="ruby-identifier">docs</span><span class="ruby-operator">|</span>
      <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">each_part</span>(<span class="ruby-identifier">subject</span>.<span class="ruby-identifier">comment</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">doc</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">tester</span>.<span class="ruby-identifier">test_path</span>(<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">file</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">raise</span>)
          <span class="ruby-keyword">yield</span> [<span class="ruby-identifier">doc</span>, <span class="ruby-identifier">subject</span>]
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">enum_for</span> <span class="ruby-value">:each_part</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-join_docs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">join_docs</span><span
                                class="method-args">(docs, separator: &quot;----&quot;)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="join_docs-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 299</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">join_docs</span>(<span class="ruby-identifier">docs</span>, <span class="ruby-value">separator:</span> <span class="ruby-string">&quot;----&quot;</span>)
  <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>()

  <span class="ruby-identifier">docs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">doc</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">formatter</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">doc</span>
    <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">margin</span>(<span class="ruby-value">separator:</span> <span class="ruby-identifier">separator</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-value">newline_at_end:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-replace_comment" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">replace_comment</span><span
                                class="method-args">(commented, string)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="replace_comment-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 372</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">replace_comment</span>(<span class="ruby-identifier">commented</span>, <span class="ruby-identifier">string</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">string</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">string</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">commented</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value">:@comment</span>, <span class="ruby-keyword">nil</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">commented</span>.<span class="ruby-identifier">instance_variable_set</span>(
        <span class="ruby-value">:@comment</span>,
        <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Comment</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">location:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">string:</span> <span class="ruby-identifier">string</span>)
      )
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_doc_source" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_doc_source</span><span
                                class="method-args">(copy, tester:) { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_doc_source-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 53</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_doc_source</span>(<span class="ruby-identifier">copy</span>, <span class="ruby-value">tester:</span>)
  <span class="ruby-keyword">case</span>
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">copy</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">mn</span> = <span class="ruby-identifier">copy</span>.<span class="ruby-identifier">method_name</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">copy</span>.<span class="ruby-identifier">singleton?</span>
    <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">copy</span>.<span class="ruby-identifier">type_name</span>, <span class="ruby-value">singleton_method:</span> <span class="ruby-identifier">mn</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">copy</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">mn</span> = <span class="ruby-identifier">copy</span>.<span class="ruby-identifier">method_name</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">copy</span>.<span class="ruby-identifier">singleton?</span>
    <span class="ruby-identifier">doc_for_method</span>(<span class="ruby-identifier">copy</span>.<span class="ruby-identifier">type_name</span>, <span class="ruby-value">instance_method:</span> <span class="ruby-identifier">mn</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">copy</span>
    <span class="ruby-identifier">doc_for_class</span>(<span class="ruby-identifier">copy</span>.<span class="ruby-identifier">type_name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">doc_for_constant</span>(<span class="ruby-identifier">copy</span>.<span class="ruby-identifier">type_name</span>, <span class="ruby-value">tester:</span> <span class="ruby-identifier">tester</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">yield</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_name</span><span
                                class="method-args">(name, outer:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_name-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/annotate/rdoc_annotator.rb, line 385</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_name</span>(<span class="ruby-identifier">name</span>, <span class="ruby-value">outer:</span>)
  <span class="ruby-identifier">namespace</span> = <span class="ruby-identifier">outer</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-constant">RBS</span><span class="ruby-operator">::</span><span class="ruby-constant">Namespace</span>.<span class="ruby-identifier">root</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ns1</span>, <span class="ruby-identifier">ns2</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">ns1</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ns2</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">namespace</span>).<span class="ruby-identifier">relative!</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

